import { IPaginationQuery } from './common.type';

/**
 * 菜单实体（响应）
 */
export interface IMenu {
  id: string;
  name: string;
  permission: string;
  type: number;
  sort: number;
  parentId?: string | null;
  path?: string | null;
  icon?: string | null;
  component?: string | null;
  visible: boolean;
  keepAlive: boolean;
  createdAt?: string | null;
  updatedAt?: string | null;
}

/**
 * 菜单树节点（用于前端展示）
 */
export interface IMenuTree {
  id: string;
  name: string;
  permission: string;
  type: number;
  sort: number;
  parentId?: string | null;
  path?: string | null;
  icon?: string | null;
  component?: string | null;
  visible: boolean;
  keepAlive: boolean;
  children?: IMenuTree[];
}

/**
 * 创建菜单请求
 */
export interface ICreateMenu {
  name: string;
  permission: string;
  type?: number;
  sort?: number;
  parentId?: string;
  path?: string;
  icon?: string;
  component?: string;
  visible?: boolean;
  keepAlive?: boolean;
}

/**
 * 更新菜单请求
 */
export interface IUpdateMenu {
  name?: string;
  permission?: string;
  type?: number;
  sort?: number;
  parentId?: string;
  path?: string;
  icon?: string;
  component?: string;
  visible?: boolean;
  keepAlive?: boolean;
}

/**
 * 查询菜单请求
 */
export interface IQueryMenu extends IPaginationQuery {
  name?: string;
}
